package quick_sort;

import java.io.*;


public class Main {
    static int a[] = new int[100010];
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(System.out));
        int n = Integer.parseInt(bufferedReader.readLine());
        String s[] =  bufferedReader.readLine().split(" ");
        for (int i = 0; i < n; i ++ ){
            a[i] = Integer.parseInt(s[i]);
        }
        quickSort(a, 0, n - 1);
        for (int i = 0; i < n; i ++ )
            printWriter.print(a[i] + " ");
        printWriter.flush();
    }
    private static void quickSort(int[] a, int l, int r) {
        if (l >= r) return;
        int i = l - 1;
        int j = r + 1;
        int x = a[l + r >> 1];
        while (i < j){   // 以 x 的数值分治
            do i ++; while (a[i] < x);
            do j --; while (a[j] > x);
            if (i < j) {
                int t = a[i];
                a[i] = a[j];
                a[j] = t;
            }
        }
        quickSort(a, l, j);
        quickSort(a, j + 1, r);
    }

}

